package class02;

import javax.xml.soap.Node;

/**
 * @author ：liweisheng
 * @date ：2022/1/2 11:31
 * @description：链表
 */
public class Classes02 {

    //TODO 定义节点
    public static class Node{
        private int value;
        private Node next;

        public Node(int data){
            this.value=data;
        }
    }

    //TODO 实现反转链表逻辑
    public Node reverseLinkedList(Node head){

        Node pre=null;
        Node next=null;

        while (head !=null){
            next=head.next;
            head.next=pre;
            pre=head;
            head=next;
        }


        return pre;
    }

    public static Node generateRandomLinkedList(int len, int value){
        int size=((int)Math.random()*(len+1));

        Node node = new Node((int) Math.random() * (value + 1));
        node.next=null;
        size--;

        while (size > 0){

        }




        return null;
    }

    //
    public static void main(String[] args) {
        System.out.println("ce");
    }
}
